package main

import (
	"fmt"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/AES"
)

func main() {
	// 密钥长度必须为16(AES-128)、24(AES-192)或32(AES-256)字节
	key := []byte("comic-2025-03-26")
	plaintext := []byte("Hello, AES ECB mode with PKCS7 padding!")

	// 加密
	ciphertext, err := AES.ECB.Encrypt(plaintext, key)
	if err != nil {
		fmt.Println("Encrypt error:", err)
		return
	}
	fmt.Printf("加密结果: %x\n", ciphertext)

	// 解密
	decrypted, err := AES.ECB.Decrypt([]byte(ciphertext), key)
	if err != nil {
		fmt.Println("Decrypt error:", err)
		return
	}
	fmt.Printf("解密结果: %s\n", decrypted)
}
